package cn.tedu.management.portal.service.impl;

import cn.tedu.management.portal.ex.InsertException;
import cn.tedu.management.portal.model.Performance;
import cn.tedu.management.portal.mapper.PerformanceMapper;
import cn.tedu.management.portal.service.IPerformanceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author tedu.cn
 * @since 2020-12-08
 */
@Service
public class PerformanceServiceImpl extends ServiceImpl<PerformanceMapper, Performance> implements IPerformanceService {

    @Autowired
    PerformanceMapper performanceMapper;

    @Override
    public void updateByStaffId(int staffId, double allPerformance) {

        if(allPerformance<0){
            throw new InsertException("输入数据错误！");
        }
        performanceMapper.updataByStaffId(staffId,allPerformance);

    }
}
